﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using Vit.Web.Mvc.DataAnnotations;

namespace Vit.DynamicFormModule.Areas.Form.Models
{
    public class DynamicForm
    {
        [Key]
        [StringLength(50)]
        [Required]
        public string FormName { get; set; }
        [StringLength(50)]
        [Required]
        public string Caption { get; set; }
        [StringLength(500)]
        public string Desription { get; set; }

        [DataSource(typeof(FormActionType))]
        [UIHint("DataSource")]
        public int? ActionType { get; set; }
        [StringLength(500)]
        public string ActionParas { get; set; }
        [StringLength(50)]
        public string Enctype { get; set; }
        [StringLength(50)]
        public string Target { get; set; }
        [StringLength(50)]
        public string Template { get; set; }
        [StringLength(2000)]
        public string OnLoad { get; set; }
        [StringLength(2000)]
        public string BeforeSubmit { get; set; }

        public virtual ICollection<FormField> Fields { get; set; }
        public virtual ICollection<FormInput> Inputs { get; set; }
    }
}